// 日期时间格式转换
export function formatDate (date, space = '') {
    const month = (date.getMonth() + 1) < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1
    const day = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()
    if (space === '') {
        return month + '月' + day + '日'
    } else {
        return month + space + day
    }
}

export function formatMinutes (date, space = '-') {
    const year = date.getFullYear()
    const month = (date.getMonth() + 1) < 10 ? `0${date.getMonth() + 1}` : date.getMonth() + 1
    const day = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate()
    const hour = date.getHours() < 10 ? `0${date.getHours()}` : date.getHours()
    const minutes = date.getMinutes() < 10 ? `0${date.getMinutes()}` : date.getMinutes()
    return year + space + month + space + day + '   ' + hour + ':' + minutes
}

if (options.extract) {
    return ExtractTextPlugin.extract({
    use: loaders,
    fallback: 'vue-style-loader',
    publicPath: '../../'
    })
    } else {
    return ['vue-style-loader'].concat(loaders)
}
